Re: [GENERAL] Problems with '||' concatenation operator.

Поиск
Список
Период
Сортировка
От Stuart Rison
Тема Re: [GENERAL] Problems with '||' concatenation operator.
Дата
Msg-id v04020a06b36746d83f4f@[128.40.242.190]
обсуждение исходный текст
Ответ на Problems with '||' concatenation operator.  (Stuart Rison <stuart@ludwig.ucl.ac.uk>)
Список pgsql-general
>Beth Strohmayer wrote
>
>>cgh=> select chromosome || arm as locus from experiment;
>>ERROR:  There is more than one possible operator '||' for types 'varchar'
>>and 'b
>>pchar'
>>        You will have to retype this query using an explicit cast
>>cgh=>
>
>Try select chromosome || varchar(arm) as locus from experiment;
>

Doesn't work for me,

cgh=> select chromosome || varchar(arm) as locus from experiments;
ERROR:  parser: Syntax error at or near "arm"

neither does select chromosome || arm::varchar as locus from experiment;

but the solution is clearly in some form of casting!

I'm using PG 6.4, perhaps it's a version thing?

regards,

S.






+-------------------------+--------------------------------------+
| Stuart Rison            | Ludwig Institute for Cancer Research |
+-------------------------+ 91 Riding House Street               |
| Tel. (0171) 878 4041    | London, W1P 8BT, UNITED KINGDOM.     |
| Fax. (0171) 878 4040    | stuart@ludwig.ucl.ac.uk              |
+-------------------------+--------------------------------------+

В списке pgsql-general по дате отправления:

Предыдущее
От: Stuart Rison
Дата:
Сообщение: Problems with '||' concatenation operator.
Следующее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: [GENERAL] select from into question